package stasckdemo;

import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wx
 * Date: 2024-04-21
 * Time: 0:35
 */
public class Test {
    public static void main(String[] args) {
        //队列
        Queue<Integer> queue = new LinkedList<>();
        queue.offer(1);
        queue.offer(2);
        queue.offer(3);;

        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.poll());


        //链表
        List<LinkedList> list = new LinkedList<>();
    }

    public static void main1(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(3); // 放元素
        stack.push(2);
        stack.push(1);

        stack.pop();

        Integer peek = stack.peek();
        System.out.println(peek);
    }
}
